package com.panda.web.controller.py;

import java.util.List;
import java.util.Arrays;
import com.panda.common.core.domain.R;
import com.panda.web.domain.vo.commons.CompanyJobVO;
import com.panda.web.service.py.ICompanyService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.panda.web.utils.pageutils.PageResult;

import com.panda.common.annotation.Log;
import com.panda.common.core.controller.BaseController;
import com.panda.common.core.domain.AjaxResult;
import com.panda.common.enums.BusinessType;
import com.panda.web.domain.dto.CompanyDTO;
import com.panda.web.domain.vo.CompanyVO;


/**
 * 公司Controller
 *
 * @author cpanda
 * @date 2025-03-03
 */
@CrossOrigin
@RestController
@RequestMapping("/web/company")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class CompanyController extends BaseController {
    private final ICompanyService companyService;

    /**
     * 查询公司列表
     */
    @GetMapping("/list")
    public PageResult<CompanyVO> List(CompanyDTO dto,
                                @RequestParam("pageNum") Integer pageNum,
                                @RequestParam("pageSize") Integer pageSize) {
        //返回分页信息
        PageResult<CompanyVO> voList = companyService.PageList(dto,pageNum,pageSize);
        return voList;
    }
    /**
     * 查询公司列表 无分页
     */
    @GetMapping("/choiceList")
    public R choiceList(CompanyDTO dto) {
        List<CompanyVO> voList = companyService.choiceList(dto);
        return R.ok(voList,"ok");
    }
    /**
     * 获取公司详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(companyService.selectById(id));
    }

}
